/*
 * @Description: 路由配置 - 支持动态权限控制
 * 权限标识说明：
 * - access: 权限标识，用于控制路由访问权限
 * - 公共路由（登录、找回密码等）不需要 access 字段
 */

export default [
  {
    path: '/',
    component: '@/layouts/index',
    redirect: '/home',
  },
  {
    path: '/login',
    name: '登录',
    component: './Login',
    layout: false,
  },
  {
    path: '/find',
    name: '找回密码',
    component: './FindPw',
    layout: false,
  },
  {
    name: '首页',
    path: '/home',
    component: './Home',
    icon: 'AppstoreOutlined',
  },
  {
    name: '系统管理',
    path: '/sys_manage',
    icon: 'AppstoreOutlined',
    routes: [
      {
        name: '权限资源列表',
        path: '/sys_manage/permission_list',
        component: './PermissionList',
        icon: 'AppstoreOutlined',
      },
      {
        name: '公司管理',
        path: '/sys_manage/company_list',
        component: './CompanyList',
        icon: 'AppstoreOutlined',
      },
      {
        name: '用户列表',
        path: '/sys_manage/user_list',
        component: './UserList',
        icon: 'AppstoreOutlined',
      },
      {
        name: '角色列表',
        path: '/sys_manage/role_list',
        component: './RoleList',
        icon: 'AppstoreOutlined',
      },
    ],
  },
  {
    name: '用户管理',
    path: '/users_manage',
    icon: 'AppstoreOutlined',
    routes: [
      {
        name: '用户列表',
        path: '/users_manage/user_list',
        component: './UsersManage/UsersList',
      },
    ],
  },
  {
    name: '房源管理',
    path: '/house_manage',
    icon: 'AppstoreOutlined',
    routes: [
      {
        name: '房源列表',
        path: '/house_manage/house_list',
        component: './HouseList',
      },
      {
        name: '小区列表',
        path: '/house_manage/community_list',
        component: './CommunityList',
      },
      {
        name: '出租信息',
        path: '/house_manage/rental_form',
        component: './HouseList/RentalForm',
        hideInMenu: true, // 不在菜单中显示
      },
      {
        name: '房屋详情',
        path: '/house_manage/detail/:id',
        component: './HouseList/Detail',
        hideInMenu: true, // 不在菜单中显示
      },
    ],
  },
];
